<?php

require_once 'OpenID/Extension.php';

class OpenID_Extension_UI extends OpenID_Extension
{
    protected $namespace ='http://specs.openid.net/extensions/ui/1.0';
    protected $alias = 'ui';

    protected $validModes = array('popup');

    public function set($key, $value)
    {
        if (strpos($key, 'mode') === 0) {
            if (!in_array($value, $this->validModes)) {
                throw new OpenID_Extension_Exception('Invalid UI mode: ' . $key);
            }
        }

        parent::set($key, $value);
    }
}
?>
